package de.bml.versandanzeige;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class SQLiteOpenHelper extends android.database.sqlite.SQLiteOpenHelper {

	private static final String DATABASE_NAME = "userData.db";
	private static final int DATABASE_VERSION = 20;

	public static final String COLUMN_ID = "_id";

	public SQLiteOpenHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		Gegenstandstyp.onCreate(db);
		Gegenstand.onCreate(db);
		Standort.onCreate(db);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.w(Gegenstand.class.getName(), "Upgrading database from version " + oldVersion + " to "
				+ newVersion + ", which will destroy all old data");
		Gegenstandstyp.onUpgrade(db);
		Gegenstand.onUpgrade(db);
		Standort.onUpgrade(db);
	}

}
